<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <title>CDR Explorer</title>
  <%= stylesheet_link_tag 'main' %>
  <%= stylesheet_link_tag 'themes/base/jquery.ui.all' %>
  <%= javascript_include_tag 'jquery-1.4.4' %>
  <%= javascript_include_tag 'ui/jquery.ui.core' %>
  <%= javascript_include_tag 'ui/jquery.ui.widget' %>
  <%= javascript_include_tag 'ui/jquery.ui.datepicker' %>
  <script>
	$(function() {
		$( "#from" ).datepicker();
		$( "#to" ).datepicker();
	});
  </script>
</head>
<body id="cdr">
<div id="banner">
	<ul>
	<li>
		<%= link_to "Destination Number", 	:controller=>"callcache", 	:action=>"dest_phone_index", 	:menu_name=>"Destination Number", 	:id=>"dummy" %>
	</li>
	<li>
		<%= link_to "Source Number(US)", 	:controller=>"callcache", 	:action=>"src_phone_index", 	:menu_name=>"Source Number(US)", 	:id=>"dummy"%>
	</li>
	<li>
		<%= link_to "Source Number(INT)", 	:controller=>"callcache", 	:action=>"src_phone_index_international", :id=>"dummy", :menu_name=>"Source Number(INT)"%>
	</li>
	<li>
		<%= link_to "Destination IPs", 		:controller=>"callcache", 	:action=>"dest_ip_index", 		:menu_name=>"Destination IPs", 		:id=>"dummy"%>
	</li>
	<li>
		<%= link_to "Source IPs", 			:controller=>"callcache", 	:action=>"src_ip_index", 		:menu_name=>"Source IPs", 			:id=>"dummy"%>
	</li>
	<li>		
		<%= link_to "CDR", 					:controller=>"cdr", 		:action=>"index", 				:menu_name=>"CDR", 					:id=>"dummy"%>
	</li>
	
	</ul>
</div>
<br />
<div id="main">
	<% if controller.controller_name != "cdr" %>
	<% form_tag({:controller=>controller.controller_name, :action=>controller.action_name}, :method=>"get") do %>
	<%= radio_button_tag(:p, "today", (params[:p]=="today" or params[:p]==nil)) %>
	<%= label_tag(:p_today, "today") %>
	
	<%= radio_button_tag(:p, "yesterday", params[:p]=="yesterday") %>
	<%= label_tag(:p_yesterday, "since yesterday") %>
	
	<%= radio_button_tag(:p, "week", params[:p]=="week") %>
	<%= label_tag(:p_week, "for one week") %>
	
	<%= radio_button_tag(:p, "month", params[:p]=="month") %>
	<%= label_tag(:p_month, "for one month") %>
	
	<%= radio_button_tag(:p, "year", params[:p]=="year") %>
	<%= label_tag(:p_year, "for one year") %>
	
	<%= radio_button_tag(:p, "other", params[:p]=="other") %>
	<%= label_tag(:p_other, "other") %>
	
	<%= label_tag(:from, "From:") %>
	<%= text_field_tag(:from) %>
	 ~ 
	<%= label_tag(:to, "To:") %>
	<%= text_field_tag(:to) %>
	<% if controller.controller_name == "fact_dest_trunk_groups" %>
	<br />
	<% require "config/cdr_config.rb" %>
	<% DATA_CENTERS.each do |d| %>
		<%= check_box_tag("#{d}", 1, params[d]=="1") %> 
		<%= d %>	
	<% end %>
	<% end %>
	<%= submit_tag("Search") %>
	<% end #form_tag%>
	<% end #if controller_name != cdr %>
<div id="title">
	<h3><%= get_title %></h3>
</div>
<p style="color: green"><%= flash[:notice] %></p>
<%= yield :layout%>
</div>

</body>
</html>
